<template>
	<div class="content">
        <div class='rata'>     
            <div class='rata_r'>
                <div class='top-rated'>
                    <p class='title'>近期最受期待</p>
                    <div class="most-expected-list">
  
    <a class="expected-item" data-id="1337700" href="/asgard/movie/1337700">
      <div class="poster default-img-bg">
        <img src="https://p1.meituan.net/movie/6876f0a4db61cab652fdc3d3ed14e94c4924473.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">342916</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1337700">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">中国医生</h5>
      <p class="date">7月9日</p>
    </a>
  
    <a class="expected-item" data-id="1250950" href="/asgard/movie/1250950">
      <div class="poster default-img-bg">
        <img src="https://p0.meituan.net/movie/72c7a8e55d97a8502c64495399fc3fb12010824.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">48085</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1250950">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">俑之城</h5>
      <p class="date">7月9日</p>
    </a>
  
    <a class="expected-item" data-id="1298542" href="/asgard/movie/1298542">
      <div class="poster default-img-bg">
        <img src="https://p0.meituan.net/movie/9c591cd51976da6fbc999c3baf57c5234268625.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">179899</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1298542">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">白蛇2：青蛇劫起</h5>
      <p class="date">7月23日</p>
    </a>
  
    <a class="expected-item" data-id="1303100" href="/asgard/movie/1303100">
      <div class="poster default-img-bg">
        <img src="https://p0.meituan.net/movie/df89b11a57dd63760a6c3d544c61e4a83956828.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">41599</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1303100">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">新大头儿子和小头爸爸4：完美爸爸</h5>
      <p class="date">7月9日</p>
    </a>
  
    <a class="expected-item" data-id="1375543" href="/asgard/movie/1375543">
      <div class="poster default-img-bg">
        <img src="https://p1.meituan.net/movie/1d3875025a9496c3b6d0add6d59b51c11820736.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">323316</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1375543">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">盛夏未来</h5>
      <p class="date">8月13日</p>
    </a>
  
    <a class="expected-item" data-id="1218188" href="/asgard/movie/1218188">
      <div class="poster default-img-bg">
        <img src="https://p0.meituan.net/movie/d54457e82843ea19401bfefd46f3966a2198541.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">188497</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1218188">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">怒火·重案</h5>
      <p class="date">7月30日</p>
    </a>
  
    <a class="expected-item" data-id="1371295" href="/asgard/movie/1371295">
      <div class="poster default-img-bg">
        <img src="https://p0.meituan.net/movie/e8e65a26c4fbf0f3f689fdc13444b93c824246.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">71026</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1371295">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">燃野少年的天空</h5>
      <p class="date">7月17日</p>
    </a>
  
    <a class="expected-item" data-id="1432307" href="/asgard/movie/1432307">
      <div class="poster default-img-bg">
        <img src="https://p1.meituan.net/movie/846bea292e5ea3985a4b53ea126284702880046.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">39394</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1432307">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">济公之降龙降世</h5>
      <p class="date">7月16日</p>
    </a>
  
    <a class="expected-item" data-id="1212472" href="/asgard/movie/1212472">
      <div class="poster default-img-bg">
        <img src="https://p1.meituan.net/movie/6c41bf547903f7849e1ccb0cd76d2cbe2538020.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">41442</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1212472">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">冲出地球</h5>
      <p class="date">7月30日</p>
    </a>
  
    <a class="expected-item" data-id="1189881" href="/asgard/movie/1189881">
      <div class="poster default-img-bg">
        <img src="https://p1.meituan.net/movie/e589b45c7fdd71317c2d364eb943c3702370662.jpg@1l_1e_1c_170w_230h" onerror="this.style.visibility='hidden'">
        <span class="wish-bg"></span>
        <span class="wish"><span class="wish-num">20046</span>人想看</span>
        <div class="toggle-wish" data-wishst="0" data-movieid="1189881">
          <span></span>
        </div>
      </div>
      <h5 class="name line-ellipsis">最后一间房</h5>
      <p class="date">8月6日</p>
    </a>
  

</div>
                </div>
            </div>
        </div>
        <ul class="list">
			<li v-for="(item,index) in preList" :key="item.id" class="item">
                <div class="comingTile">{{index==0?preList[index].comingTitle:preList[index].comingTitle!=preList[index-1].comingTitle?preList[index].comingTitle:""}}</div>
				<router-link :to="'/item/' + item.id">
					<div class="item_img"><img :src="item.img" /></div>
					<div class="item_text">
						<div class="layer_1">
							<span class="title">{{ item.nm }}</span>
							<span
								v-show="item.version.split(/\s+/)[0][0]"
								class="version"
								:class="item.version"
							></span>
						</div>
						<div class="item_content">
							<div v-if="item.globalReleased">
								<div v-if="item.sc != 0">
									<span>影评</span
									><span class="light_score">{{ item.sc }}</span>
								</div>
								<div v-else><span>暂无评分</span></div>
							</div>
							<div v-else>
								<span class="light_wish">{{ item.wish }}</span
								><span>人想看</span>
							</div>
							<div class="text-wrap">
								<span>主演</span><span class="star">{{ item.star }}</span>
							</div>
							<div>{{ item.showInfo }}</div>
						</div>
					</div>
					<div class="item_btn">
						<div v-if="item.showst>=4" class="btn ysbtn">预售</div>
						<div v-else class="btn wishbtn">想看</div>
					</div>
				</router-link>
			</li>
		</ul>
    </div>
</template>
<script>
import axios from "axios";
export default {
	name: "wait",
    data:function(){
        return {
            preMovie:[],
            preList:[]
        }
    },
	mounted() {
        //最受期待
		axios
			.get(
				"/ajax/mostExpected?ci=62&limit=10&offset=0&token=&optimus_uuid=689A5D80D8D611EBB79063E128DD6EEBEF880FE3D08F4A2D8F5969A1FDA61E2F&optimus_risk_level=71&optimus_code=10"
			)
			.then((res) => {
                this.preMovie=res.data.coming;
                //
                this.preMovie.forEach(element => {
                    element.img=element.img.replace('w.h','64.90');
                });
			});
		//待映列表
		axios
			.get(
				"/ajax/comingList?ci=62&token=&limit=10&optimus_uuid=689A5D80D8D611EBB79063E128DD6EEBEF880FE3D08F4A2D8F5969A1FDA61E2F&optimus_risk_level=71&optimus_code=10"
			)
			.then((res) => {
				console.log(res.data.coming);
                this.preList=res.data.coming;
                this.preList.forEach(item=>{
                    item.img=item.img.replace('w.h','64.90');
                })
			});
	},
};
</script>
<style>
 /* .content .rata .rata_r .top-rated{
   display: flex;
} */
/* .content .rata .rata_r .top-rated .top-rated-list .top-rated-item span {
    display: flex;
    flex-direction: row;
}  */
div {
    display: block;
}

.content .rata .rata_r .top-rated .most-expected-list {
    overflow: scroll;
    white-space: nowrap;
}
.content .rata .rata_r .top-rated .most-expected-list .expected-item {
    display: inline-block;
    width: 85px;
    overflow: hidden;
    margin-right: 10px;
}

.content .rata .rata_r .top-rated .most-expected-list .expected-item  .default-img-bg img{
    width: 85px;
    height: 115px;
    position: relative;
    margin-bottom: 6px;
}

.content .rata .rata_r .top-rated .most-expected-list .expected-item .poster img {
    background-color: #e1e1e1;
    background-size: 100% 100%;
}
.poster.default-img-bg .love{
    position: absolute;
    width:28px;
    height:28px;
    top:0;
    left:0;
    background:rgba(61,63,71,.6);
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom-right-radius: 10px;
}
.poster.default-img-bg .love span{
    display: inline-block;
    width:10px;
    height:10px;
    background:url("");
    background-size: 100%;
    background-repeat: no-repeat;;
}
.poster-pre-date{
    margin-left: 2%;
    color: #999;
}
.comingTile{
    margin-left: 5px;
    font-size:18px;
    margin-bottom:10px;
}
.rata{
	background:#fff;
}
.top-rated{
	width: 100%;
	/* margin-top:156px; */
	padding-top:.32rem;
	padding-bottom:.32rem;
	display: flex;
	flex-direction: column;
	margin-left:.266667rem;
}
.rata_r {
	width: 98%;
	margin: 0 atuo;
	display: flex;
	flex-direction: column;
	justify-items: center;
	align-items: center;
}
div::-webkit-scrollbar {
	display: none;
}
.top-rated-list {
	height:3.92rem;
	overflow-x: scroll;
	overflow-y: hidden;
	display: flex;
	flex-direction: row;
}
.top-rated p {
	flex:1;
	font-size: 14px;
	color: #333;
	font-weight: 400;
}
.top-rated-item{
	width: 100%;
	min-width: 2.266667rem;
	max-width: 100%;
	margin:.133333rem;
	margin-bottom:0;
	display: flex;
	flex-direction: column;
	text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.top-rated-item:first-child{
	margin-left:0;
}
.poster {
	width:100%;
	height:3.066667rem;
	display: flex;
	flex-direction: column;
	text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
	position: relative;
}
.poster img {
	width:100%;
	height:100%;
}
.wish-bg{
	display: inline-block;
    width: 100%;
    height: .933333rem;
    position: absolute;
    bottom: 0;
    background-image: -webkit-linear-gradient(top,rgba(77,77,77,0),rgb(165, 151, 151));
    background-image: linear-gradient(-180deg,rgba(77,77,77,0),#000);
}
.score {
	flex:1;
	color: #faaf00;
	font-size: .293333rem;
	font-weight: 600;
	display: inline-block;
	box-sizing: border-box;
	margin:-0.56667rem auto 0 auto;
	z-index:99;
	transform: scale(.9);
}
.wish{
	flex:1;
	color: #faaf00;
	font-size: .293333rem;
	font-weight: 600;
	display: inline-block;
	box-sizing: border-box;
	margin:-0.56667rem auto;
	z-index:99;
	transform: scale(.85);
}
.name {
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	margin-left:2%;
}
.line-ellipsis {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.list {
	margin-top: .266667rem;
	padding-top:.266667rem;
	background:#fff;
}
.list li:last-child {
	margin-bottom: 50px;
}
.item{
	width:100%;
	height:100%;
	margin-bottom: 15px;
}
.item a{
	width: 100%;
	display: flex;
	justify-content: space-around;
	border-bottom: 1px solid #fffff1;
}

.item .item_img {
	width: 20%;
}

.item .item_img img {
	width: 100%;
}

.item .item_text {
	width: 50%;
	display: flex;
	flex-direction: column;
}

.item .item_btn {
	width: 20%;
	display: flex;
	align-items: center;
}

.item .item_btn .btn {
	width: 1.253333rem;
	height: 0.72rem;
	color: #fff;
	border-radius: 5px;
	line-height: 0.72rem;
	text-align: center;
}

.item .item_btn .gpbtn {
	background: #f03d37;
}

.item .item_btn .ysbtn {
	background: #3c9fe6;
}
.item .item_btn .wishbtn {
	background: #faaf00;
}
span.version.v2d.imax {
	flex-basis: 43px;
	height: 14px;
	background: url("");
	background-size: contain;
}
.layer_1 {
	max-height: 24px;
	line-height: 24px;
	display: flex;
	align-items: center;
}
.title {
	font-size: 17px;
	font-weight: 700;
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	flex-shrink: 1;
	padding-right: 5px;
}
.light_score{
	color: #faaf00;
	font-size: 15px;
	font-weight: 600;
	margin-left:10px;
}
.light_wish{
	color: #faaf00;
	font-size: 15px;
	font-weight: 600;
	margin-right:10px;
}
.text-wrap {
	width: 148px;
	font-size: 13px;
	color: #666;
	text-overflow: ellipsis;
	overflow: hidden;
	display: inline-block;
	white-space: nowrap;
}
.star {
	margin-left: 10px;
	text-overflow: ellipsis;
	overflow: hidden;
}
.item_content {
	color: #666;
	font-size: 13px;
	display: flex;
	flex-direction: column;
	height:100%;
	justify-items: center;
}
.item_content div{
	flex:1;
}
</style>